package com.example.controller;

import com.example.common.Result;
import com.example.entity.AiTalk;
import com.example.service.AiTalkService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/ai")
@Api(value = "AI对话", tags = {"让AI扮演某个角色与用户交流"})
public class AiTalkController
{
    @Resource
    private AiTalkService aiTalkService;
    @ApiOperation(value = "对话", notes = "返回的data中是AI的回复")
    @PostMapping("/talk")
    public Result talk(@RequestBody AiTalk aiTalk)
    {
        return Result.success(aiTalkService.talk(aiTalk));
    }
}
